﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="UdfReportSetting.aspx.cs" Inherits="WMS6.Web.Administration.UdfReportSetting" meta:resourcekey="PageResource1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>UdfReportSetting</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />
    <link rel="Stylesheet" href="../Js/UpLoad/uploadify.css" />
    <script src="../Js/jquery.js" type="text/javascript"></script>

    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>

    <script src="../Js/util.js" id="js" type="text/javascript"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <script src="../Js/checkbox.js" type="text/javascript"></script>

    <script type="text/javascript" src="../Js/UpLoad/swfobject.js"></script>

    <script type="text/javascript" src="../Js/UpLoad/jquery.uploadify.min.js"></script>

  
   
    <script type="text/javascript">
        //初始化页面
        window.onload = function() {
            initEditNewPage();
        }

        function newSysCode() {
            var from = document.getElementById("hdnFrom").value;
            window.location.href = "UdfReportSetting.aspx?from=" + escape(from);
            return false;
        }
        function confirmMsg(code) {
            if (code == "C001") {
                if (confirm('<%=GetGlobalMsgResource("C001") %>')) {
                    return true;
                }
                else {
                    return false;
                }
            }
            else if (code == "C010") {
                if (confirm('<%=GetGlobalMsgResource("C010") %>')) {
                    return true;
                }
                else {
                    return false;
                }
            }
            else if (code == "F1870_001") {
                if (confirm('<%=GetGlobalMsgResource("F1870_001") %>')) {
                    return true;
                }
                else {
                    return false;
                }
            }
            else if (code == "F1800_012") {
                if (confirm('<%=GetGlobalMsgResource("F1800_012") %>')) {
                    return true;
                }
                else {
                    return false;
                }
            }
        }
        
         
      $(document).ready(function() {
            $("#uploadify").uploadify({
                'uploader': '../Js/UpLoad/uploadify.swf',
                'script': '../Common/JQUpLoad.aspx?Type=REPORT',
                'cancelImg': '../Js/UpLoad/cancel.png',
                'folder': 'upload',
                'queueID': 'fileQueue',
                'auto': false,
                'multi': false, //是否支持多文本         
                'fileExt':'*.frx',
                'fileDesc':'请选择frx文件',   
                 'onSelect':function(){if(confirm('是否确定要上传的报表?')){  $('#uploadify').uploadifyUpload();}},　
                 'onComplete': function(event, queueID, fileObj, response, data) {      
                 document.getElementById('hdnReportFile').value=response;   
                 document.getElementById('txtReportFile').value=response;
                }
            });
        });  

    </script>
</head>
<body>
    <form id="F1871" runat="server">
   <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblUdfReportSetting" runat="server" CssClass="label_header" Text="UDF报表设置" meta:resourcekey="lblUdfReportSetting"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnGoBack" runat="server" CssClass="button" Enabled="False" Text="<%$ Resources:ButtonResource,btnGoBack %>"
                            OnClick="btnGoBack_Click" meta:resourcekey="btnGoBack" />
                    </td>
                    <td>
                        <asp:Button ID="btnNew" runat="server" Enabled="False"  CssClass="button"
                            Text="<%$ Resources:ButtonResource,btnNew %>" AccessKey="n" 
                            OnClientClick="newSysCode();return false;" meta:resourcekey="btnNewResource1" />
                    </td>
                    <td>
                        <asp:Button ID="btnSave" runat="server" CssClass="button" Enabled="False" Text="<%$ Resources:ButtonResource,btnSave %>"
                            AccessKey="s" OnClick="btnSave_Click" 
                            meta:resourcekey="btnSaveResource1" />
                    </td>
                    <td>
                        <asp:Button ID="btnDelete" runat="server" CssClass="button" Enabled="False" Text="<%$ Resources:ButtonResource,btnDelete %>"
                            AccessKey="d" OnClientClick="javascript:if(confirmMsg('F1800_012')) return true; else return false;"
                            OnClick="btnDelete_Click" meta:resourcekey="btnDeleteResource1" />
                    </td>                   
                </tr>
            </table>
        </div>
                <div>
                    <asp:Label ID="lblMsg" runat="server" CssClass="label_message" meta:resourcekey="lblMsg"></asp:Label>
                </div>
                <div id="div_menu">
                    <div style="float: left; width: 8px;">
                        <div class="tabL" id="divL1">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur" onclick="setTab('one',1,2)"
                        id="divM1">
                        <asp:Label ID="one1" CssClass="hover" runat="server" meta:resourcekey="one1">常规</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR" id="divR1">
                        </div>
                    </div>
                    
                    <div style="float: left; width: 8px;">
                        <div class="tabL_1" id="divL2">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur_1" onclick="setTab('one',2,2);"
                        id="divM2">
                        <asp:Label ID="one2" CssClass="navigationlabel" runat="server" meta:resourcekey="one2">明细</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR_1" id="divR2">
                        </div>
                    </div>
                </div>
                <div id="div_content">
                    <div id="con_one_1" style="display: block;">
                        <table width="720px;" style="display: block; margin-left: 10px; margin-top: 10px;">
                            <tr>
                                <td width="180">
                                    <asp:Label ID="lblReportID" CssClass="label" runat="server" Text="报表代码" meta:resourcekey="lblReportID"></asp:Label><span class="must_input">*</span>
                                </td>
                                <td width="180">
                                    <asp:Label ID="lblReportName" CssClass="label" runat="server" Text="报表名称" meta:resourcekey="lblReportName"></asp:Label><span class="must_input">*</span>
                                </td>
                                <td width="360">
                                    <asp:Label ID="lblSQL" CssClass="label" runat="server" Text="SQL" meta:resourcekey="lblSQL"></asp:Label><span class="must_input">*</span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtReportID" runat="server" CssClass="textbox" meta:resourcekey="txtReportID"></asp:TextBox>
                                </td>
                                 <td>
                                    <asp:TextBox ID="txtReportName" runat="server" CssClass="textbox" meta:resourcekey="txtReportName"></asp:TextBox>
                                </td>
                                <td rowspan="5">
                                    <asp:TextBox ID="txtSQL" runat="server" CssClass="largetextarea" Height="104px" MaxLength="5000" TextMode="MultiLine" meta:resourcekey="txtSQL"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblDataSourceName1" CssClass="label" runat="server" Text="数据源1" meta:resourcekey="lblDataSourceName1"></asp:Label>
                                </td>
                                 <td>
                                    <asp:Label ID="lblDataSourceName2" CssClass="label" runat="server" Text="数据源2" meta:resourcekey="lblDataSourceName2"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtDataSourceName1" runat="server" CssClass="textbox" meta:resourcekey="txtDataSourceName1" ></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDataSourceName2" runat="server" CssClass="textbox" meta:resourcekey="txtDataSourceName2" ></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblReprotFile" CssClass="label" runat="server" Text="文件名称" meta:resourcekey="lblReprotFile"></asp:Label>
                                </td>
                                 <td>
                                    <asp:Label ID="lblRemark" CssClass="label" runat="server" Text="备注" meta:resourcekey="lblRemark"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtReportFile" runat="server" CssClass="textbox" meta:resourcekey="txtReportFile" ></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtRemark" runat="server" CssClass="textbox" meta:resourcekey="txtRemark" ></asp:TextBox>
                                </td>
                            </tr>
                            <tr style="height:10px;">
                                <td>
                                
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                              <td>
                             <input type="file" name="uploadify" id="uploadify" />    
                            </td>
                            <td>
                             
                            </td>
                            </tr>
                            <tr>
                            <td colspan=2>
                              <div id="fileQueue"></div>
                            </td>
                            </tr>
                            <tr style="height:10px;">
                                <td>
                                
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="con_one_2" style="display: none; overflow-x:auto; overflow-y:hidden;">
                        <table width="760px" style="display: block; margin-left: 10px; margin-top: 10px;">
                            <tr>
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Button ID="btnAddDetail" runat="server" CssClass="button" Text="<%$ Resources:ButtonResource,btnAddDetail %>"
                                                    Enabled="False" OnClientClick="javascript:if(document.getElementById('hdnReportID').value == ''){if(confirmMsg('F1870_001')) return true; else return false;}"
                                                    OnClick="btnAddDetail_Click" meta:resourcekey="btnAddDetailResource1" />
                                            </td>
                                            <td>
                                                <asp:Button ID="btnDeleteDetail" runat="server" CssClass="button" Text="<%$ Resources:ButtonResource,btnDeleteDetail %>"
                                                    Enabled="False" OnClientClick="javascript:if(confirmMsg('C010')) return true; else return false;"
                                                    OnClick="btnDeleteDetail_Click" 
                                                    meta:resourcekey="btnDeleteDetailResource1" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr style="height: 10px;">
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div>
                                        <asp:GridView ID="gvUdfReportSettingDetail" runat="server" AllowSorting="True" AutoGenerateColumns="False" Width="1000px"
                                            CssClass="gridview" OnRowDataBound="gvUdfReportSettingDetail_RowDataBound" OnInit="gvUdfReportSettingDetail_Init"
                                            DataKeyNames="ReportID,LineID" AllowPaging="True" OnPageIndexChanging="gvUdfReportSettingDetail_PageIndexChanging"
                                            OnSorting="gvUdfReportSettingDetail_Sorting" meta:resourcekey="gvUdfReportSettingDetail">
                                            <FooterStyle CssClass="GridViewFooterStyle" />
                                            <RowStyle CssClass="GridViewRowStyle" />
                                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                                            <PagerStyle CssClass="GridViewPageStyle" />
                                            <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                            <Columns>
                                                <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="No">
                                                    <ItemStyle CssClass="GridViewRowWidth_50" />
                                                </asp:BoundField>
                                                <asp:TemplateField meta:resourcekey="TemplateField">
                                                    <HeaderTemplate>
                                                        <asp:CheckBox ID="CheckBox1" runat="server" onclick="selectAll(this,'gvUdfReportSettingDetail');"
                                                            meta:resourcekey="CheckBox1" />
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chbSelect" runat="server" meta:resourcekey="chbSelect" />
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        <asp:CheckBox ID="CheckBox2" runat="server" onclick="selectAll(this,'gvUdfReportSettingDetail');"
                                                            meta:resourcekey="CheckBox2" />
                                                    </FooterTemplate>
                                                    <HeaderStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                                    <ItemStyle HorizontalAlign="Center" CssClass="GridViewRowWidth_50" />
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="明细" FooterText="明细" meta:resourcekey="Detail">
                                                    <ItemTemplate>
                                                        <a href='<%# FormatUrl("UdfReportSettingDetail.aspx?type=edit&from=list&ID={0}&SeqNO={1}",Eval("ReportID").ToString(),Eval("LineID").ToString()) %>'
                                                            target="_self">
                                                            <img src="../Images/icon_edit.gif" class="img" style="border: none 0px blue;" alt="receipt" /></a>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_50" HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="LineID" HeaderText="行号" FooterText="行号" SortExpression="LineID"
                                                    meta:resourcekey="LineID">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="CtrlID" HeaderText="控件ID" FooterText="控件ID" SortExpression="CtrlID"
                                                    meta:resourcekey="CtrlID">
                                                    <ItemStyle CssClass="GridViewRowWidth_150" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="CtrlLable" HeaderText="控件标题" FooterText="控件标题" SortExpression="CtrlLable"
                                                    meta:resourcekey="CtrlLable">
                                                    <ItemStyle CssClass="GridViewRowWidth_150" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="CtrlType" HeaderText="控件类型" FooterText="控件类型" SortExpression="CtrlType"
                                                    meta:resourcekey="CtrlType">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="DefaultValue" HeaderText="默认值" FooterText="默认值" SortExpression="DefaultValue"
                                                    meta:resourcekey="DefaultValue">
                                                    <ItemStyle CssClass="GridViewRowWidth_150" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="ParamName" HeaderText="参数名" FooterText="参数名" SortExpression="ParamName"
                                                    meta:resourcekey="ParamName">
                                                    <ItemStyle CssClass="GridViewRowWidth_150" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="IsMustInput" HeaderText="是否必输" FooterText="是否必输" SortExpression="IsMustInput"
                                                    meta:resourcekey="IsMustInput">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                            </Columns>
                                        </asp:GridView>
                                    </div>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr style="height:30px;">
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                 </div>
    <input type="hidden" id="hdnFlag" runat="server" value="0" />  
    </div>
    <input type="hidden" id="hdnReportID" runat="server" />
    <input type="hidden" id="hdnFrom" runat="server" />
    <input type="hidden" id="hdnReportFile" runat="server" />
    <input type="hidden" id="hdnSeqNo" runat="server" >
    </form>
</body>
</html>
